<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>排队选号系统</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
            background-color: #f5f5f5;
        }
        
        .container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            max-width: 1400px;
            margin: 0 auto;
        }
        
        .queue-component {
            background: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            border: 2px solid #e0e0e0;
            transition: all 0.3s ease;
        }
        
        .queue-component.active {
            border-color: #4CAF50;
            background-color: #f8fff8;
        }
        
        .queue-component.waiting {
            border-color: #ff9800;
            background-color: #fff8f0;
        }
        
        .queue-component.selecting {
            border-color: #2196F3;
            background-color: #f0f8ff;
        }
        
        .component-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .component-id {
            font-weight: bold;
            color: #333;
        }
        
        .status {
            padding: 5px 10px;
            border-radius: 15px;
            font-size: 12px;
            font-weight: bold;
        }
        
        .status.idle {
            background-color: #e0e0e0;
            color: #666;
        }
        
        .status.waiting {
            background-color: #ff9800;
            color: white;
        }
        
        .status.active {
            background-color: #4CAF50;
            color: white;
        }
        
        .status.selecting {
            background-color: #2196F3;
            color: white;
        }
        
        .message {
            margin: 10px 0;
            padding: 10px;
            border-radius: 5px;
            background-color: #f0f0f0;
            min-height: 20px;
        }
        
        .buttons {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }
        
        button {
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-weight: bold;
            transition: background-color 0.3s;
        }
        
        .btn-start {
            background-color: #4CAF50;
            color: white;
        }
        
        .btn-start:hover:not(:disabled) {
            background-color: #45a049;
        }
        
        .btn-start:disabled {
            background-color: #cccccc;
            cursor: not-allowed;
        }
        
        .btn-select {
            background-color: #2196F3;
            color: white;
        }
        
        .btn-select:hover {
            background-color: #1976D2;
        }
        
        .btn-end {
            background-color: #f44336;
            color: white;
        }
        
        .btn-end:hover {
            background-color: #d32f2f;
        }
        
        .connection-status {
            font-size: 12px;
            margin-top: 10px;
        }
        
        .connected {
            color: #4CAF50;
        }
        
        .disconnected {
            color: #f44336;
        }
    </style>
</head>
<body>
    <div id="app">
        <h1 style="text-align: center; color: #333;">排队选号系统</h1>
        <div class="container">
            <queue-component 
                v-for="index in 20" 
                :key="index" 
                :index="index">
            </queue-component>
        </div>
    </div>

    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script src="queue-component.js"></script>
</body>
</html>